/*
Theme Name: Tipnestly
Description: News theme for tipnestly.com — gradient header, 2 big + 4 grid lead stories, image-left story list, View all button.
Version: 1.0
Text Domain: tipnestly
*/

:root {
  --purple: #4b2fb0;
  --purple-dark: #3a2394;
  --header-from: #1f2a9c;
  --header-mid: #6b3fc9;
  --text: #2f2f2f;
  --muted: #7a7a7a;
  --line: #ececec;
  --footer-bg: #f4f4f4;
  --max-width: 1260px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 860px; }

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(90deg, var(--header-from) 0%, var(--header-mid) 45%, #5a3ac0 65%, var(--header-from) 100%);
  color: #fff;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 86px;
}
.menu-toggle, .search-toggle {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
}
.menu-toggle { display: none; }
.site-branding { flex-shrink: 0; }
.site-logo { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.logo-mark { margin-bottom: -2px; }
.logo-text {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.custom-logo { max-height: 72px; width: auto; }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.main-nav a { font-size: 18px; color: rgba(255,255,255,0.9); }
.main-nav a:hover { color: #fff; }
.main-nav .current-menu-item > a, .main-nav .current_page_item > a { color: #fff; font-weight: 700; }
.header-search-wrap { position: relative; }
.search-popover {
  display: none;
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  z-index: 40;
  width: 320px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 14px 34px -10px rgba(0,0,0,0.3);
  padding: 8px;
  gap: 6px;
}
.search-popover.open { display: flex; }
.search-popover input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
}
.search-popover input:focus { outline: none; border-color: var(--purple); }
.search-popover button {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.search-popover button svg { width: 18px; height: 18px; }

/* ---------- Drawer (mobile) ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); opacity: 0; transition: opacity .3s ease; z-index: 998; }
.drawer-overlay[hidden] { display: none; }
.drawer-close { position: absolute; top: 8px; right: 10px; background: none; border: none; color: rgba(255,255,255,0.9); cursor: pointer; padding: 6px; display: inline-flex; }
.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 80%;
  max-width: 330px;
  background: #fff;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .3s ease;
  visibility: hidden;
  z-index: 999;
  padding-top: 28px;
}
body.drawer-open { overflow: hidden; }
body.drawer-open .drawer { transform: translateX(0); visibility: visible; }
body.drawer-open .drawer-overlay { opacity: 1; }
.drawer-search { display: flex; margin: 0 14px 18px; }
.drawer-search input {
  flex: 1; min-width: 0; height: 44px;
  border: 1px solid #ddd; border-right: none; border-radius: 6px 0 0 6px;
  padding: 0 12px; font: inherit; font-size: 16px;
}
.drawer-search input:focus { outline: none; border-color: var(--purple); }
.drawer-search button {
  width: 46px; height: 44px; border: none; border-radius: 0 6px 6px 0;
  background: var(--purple); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.drawer-search button svg { width: 18px; height: 18px; }
.drawer-menu { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.drawer-menu li { border-bottom: 1px solid var(--line); }
.drawer-menu a { display: block; padding: 0 16px; line-height: 54px; font-size: 15px; font-weight: 700; text-transform: uppercase; color: #555; }
.drawer-menu .current-menu-item > a, .drawer-menu a:hover { color: var(--purple); }

/* ---------- Home ---------- */
.content-wrap { padding: 20px 0 60px; }
.thumb { display: block; overflow: hidden; background: #f2f2f2; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.thumb:hover img { transform: scale(1.03); }

.big-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.big-card .thumb { aspect-ratio: 3/2; }
.big-title {
  margin: 14px 0 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: #333;
}
.big-title a:hover, .grid-title a:hover, .row-title a:hover { color: var(--purple); }
.big-excerpt {
  margin: 6px 0 0;
  font-size: 15px;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.four-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 52px; }
.grid-card .thumb { aspect-ratio: 340/221; }
.grid-title {
  margin: 14px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  color: #333;
}

.post-list { margin-top: 52px; border-bottom: 1px solid var(--line); }
.list-row {
  display: grid;
  grid-template-columns: 500px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 10px;
  border-top: 1px solid var(--line);
}
.post-list .list-row:first-child { border-top: none; }
.list-row .thumb { aspect-ratio: 500/325; }
.row-body { padding: 0 6px; }
.row-cat { display: block; font-size: 15px; color: var(--muted); margin-bottom: 4px; }
.row-title { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.43; color: #333; }
.row-date { margin-top: 10px; font-size: 15px; color: #9a9a9a; }
.row-excerpt {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.75;
  color: #333;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

.more-wrap { text-align: center; margin-top: 38px; }
.btn-more {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
}
.btn-more:hover { background: var(--purple-dark); }
.nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.page-numbers {
  min-width: 40px; height: 40px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 999px; font-weight: 700; color: var(--purple);
}
.page-numbers.current { background: var(--purple); border-color: var(--purple); color: #fff; }
.page-heading { font-size: 26px; margin: 12px 0 0; }
.section-heading { font-size: 22px; margin: 50px 0 0; padding-left: 12px; border-left: 4px solid var(--purple); }
.empty-note { font-size: 17px; }
.empty-note a { color: var(--purple); }

/* ---------- Single / page ---------- */
.article { padding-top: 16px; }
.article-title { margin: 6px 0 0; font-size: 34px; line-height: 1.3; font-weight: 900; color: #262626; }
.article-thumb { margin: 22px 0 6px; }
.article-thumb img { width: 100%; height: auto; }
.post-content { margin-top: 20px; font-size: 18px; line-height: 1.8; color: #2b2b2b; overflow-wrap: anywhere; }
.post-content img { height: auto; margin: 14px 0; }
.post-content a { color: var(--purple); text-decoration: underline; }
.post-content h2, .post-content h3 { line-height: 1.3; margin: 1.5em 0 .5em; }
.page-links { margin: 26px 0; display: flex; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.page-links a, .page-links > span:not(:first-child) { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; }
.share-row { display: flex; gap: 10px; margin: 34px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.share-row a {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.share-facebook { background: #1877f2; }
.share-x { background: #111; }
.share-pinterest { background: #d0021b; }
.share-email { background: #8a8a8a; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); padding: 22px 0 20px; text-align: center; margin-top: 30px; }
.footer-nav {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0 0 12px;
  padding: 0;
  font-size: 14px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.footer-nav a { color: #444; }
.footer-nav a:hover { color: var(--purple); }
.footer-copyright { font-size: 16px; color: #111; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .list-row { grid-template-columns: 42% minmax(0, 1fr); }
  .row-title { font-size: 19px; }
}
@media (max-width: 960px) {
  .header-inner { min-height: 64px; gap: 10px; }
  .menu-toggle { display: inline-flex; }
  .main-nav { display: none; }
  .site-branding { margin: 0 auto; }
  .site-logo { flex-direction: row; gap: 6px; align-items: center; }
  .logo-mark { width: 34px; height: 29px; margin: 0; }
  .logo-text { font-size: 24px; }
  .four-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; margin-top: 36px; }
  .search-popover { width: calc(100vw - 32px); right: -6px; }
}
@media (max-width: 640px) {
  .content-wrap { padding: 14px 0 40px; }
  .big-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .big-excerpt { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .grid-title { font-size: 15.5px; }
  .post-list { margin-top: 36px; }
  .list-row { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 12px 0; align-items: start; }
  .list-row .thumb { aspect-ratio: 1/1; }
  .row-body { padding: 0; }
  .row-cat { font-size: 13px; margin-bottom: 2px; }
  .row-title { font-size: 16px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .row-date { margin-top: 6px; font-size: 13px; }
  .row-excerpt { display: none; }
  .article-title { font-size: 26px; }
  .post-content { font-size: 17px; }
}

/* ---------- Single: content + sidebar ---------- */
.single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
  align-items: start;
}
.single-layout .article { padding: 16px 34px 0 0; }
.article-cat {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--purple);
}
.article-cat:hover { text-decoration: underline; }
.single-layout .article-title { font-weight: 700; font-size: 32px; color: #333; margin-top: 8px; }
.article-rule { display: block; width: 32px; height: 3px; background: #e1e1e1; margin: 20px 0 16px; }
.article-meta { font-size: 12.5px; letter-spacing: 0.6px; text-transform: uppercase; color: #333; }
.article-meta a { color: var(--purple); }
.article-meta a:hover { text-decoration: underline; }
.single-layout .article-thumb { margin-top: 36px; }

.sidebar {
  border-left: 1px solid var(--line);
  padding: 20px 0 0 34px;
  align-self: stretch;
}
.widget { margin-bottom: 40px; }
.widget-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #222;
}
.widget-rule { display: block; width: 32px; height: 3px; background: #e1e1e1; margin: 14px 0 16px; }
.widget-links { list-style: none; margin: 0; padding: 0; }
.widget-links li { border-bottom: 1px solid var(--line); }
.widget-links li:last-child { border-bottom: none; }
.widget-links a {
  display: block;
  padding: 9px 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--purple);
}
.widget-links a:hover { color: var(--purple-dark); text-decoration: underline; }
.widget-links .children { list-style: none; padding-left: 14px; }

@media (max-width: 960px) {
  .single-layout { grid-template-columns: minmax(0, 1fr); }
  .single-layout .article { padding-right: 0; }
  .sidebar { border-left: none; border-top: 1px solid var(--line); padding: 30px 0 0; margin-top: 30px; }
}
@media (max-width: 640px) {
  .single-layout .article-title { font-size: 25px; }
}
