/*
Theme Name: CancelGuide
Theme URI: https://celalyildiz.com
Author: Celal
Description: A clean, SEO-optimized blog theme for "how to cancel" content with Google AdSense integration and sidebar support.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: blog
Tags: blog, two-columns, right-sidebar, custom-header, custom-logo, featured-images, sticky-post, threaded-comments, translation-ready
*/

/* ===== CSS VARIABLES ===== */
:root {
  --primary:       #1a3c5e;
  --primary-light: #2a5fa0;
  --accent:        #e84c30;
  --accent-light:  #ff6b50;
  --bg:            #f5f7fa;
  --bg-card:       #ffffff;
  --text:          #1c2b3a;
  --text-muted:    #6b7c93;
  --border:        #dde3ea;
  --sidebar-bg:    #eef1f6;
  --font-heading:  'Playfair Display', Georgia, serif;
  --font-body:     'Source Serif 4', 'Georgia', serif;
  --font-ui:       'DM Sans', 'Helvetica Neue', sans-serif;
  --radius:        8px;
  --shadow:        0 2px 12px rgba(26,60,94,0.09);
  --shadow-hover:  0 6px 24px rgba(26,60,94,0.16);
  --max-width:     1200px;
  --content-width: 760px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-heading);
  color: var(--primary);
  line-height: 1.3;
  font-weight: 700;
}

/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;800&family=Source+Serif+4:wght@400;600&family=DM+Sans:wght@400;500;600&display=swap');

/* ===== LAYOUT ===== */
.site-wrapper { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.site-content-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 36px;
  padding: 36px 0 60px;
}

@media (max-width: 900px) {
  .site-content-area { grid-template-columns: 1fr; }
}

/* ===== HEADER ===== */
#masthead {
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-branding .site-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: -0.5px;
}

.site-branding .site-title span { color: var(--accent-light); }
.site-branding .site-description { color: rgba(255,255,255,0.6); font-size: 0.78rem; font-family: var(--font-ui); margin-top: 2px; }

/* ===== NAVIGATION ===== */
#site-navigation ul {
  display: flex;
  list-style: none;
  gap: 4px;
}

#site-navigation ul li a {
  color: rgba(255,255,255,0.85);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 5px;
  transition: background 0.2s, color 0.2s;
}

#site-navigation ul li a:hover,
#site-navigation ul li.current-menu-item a {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.menu-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 6px 12px;
  border-radius: 5px;
  font-family: var(--font-ui);
  cursor: pointer;
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  #site-navigation { display: none; width: 100%; }
  #site-navigation.toggled { display: block; }
  #site-navigation ul { flex-direction: column; padding: 10px 0; }
  .header-inner { flex-wrap: wrap; gap: 10px; }
}

/* ===== HERO / TOP AD BANNER ===== */
.top-ad-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 12px 20px;
  min-height: 100px;
}

.top-ad-bar .ad-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
}

.breadcrumb-bar nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb-bar a { color: var(--primary-light); }
.breadcrumb-bar span.sep { margin: 0 6px; }

/* ===== ARCHIVE / BLOG INDEX ===== */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.post-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.post-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.post-card .post-thumbnail {
  overflow: hidden;
  background: var(--border);
  height: 100%;
  min-height: 180px;
}

.post-card .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}

.post-card:hover .post-thumbnail img { transform: scale(1.04); }

.post-card .post-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.post-card .post-category {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.post-card .post-title {
  font-size: 1.15rem;
  margin-bottom: 10px;
  line-height: 1.4;
}

.post-card .post-title a { color: var(--primary); }
.post-card .post-title a:hover { color: var(--accent); }

.post-card .post-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  font-family: var(--font-ui);
  color: var(--text-muted);
}

.post-card .post-meta .read-time { color: var(--accent); font-weight: 600; }

@media (max-width: 600px) {
  .post-card { grid-template-columns: 1fr; }
  .post-card .post-thumbnail { min-height: 180px; }
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  font-family: var(--font-ui);
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.9rem;
  color: var(--primary);
  transition: all 0.2s;
}

.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination a:hover { background: var(--primary-light); color: #fff; border-color: var(--primary-light); }

/* ===== SINGLE POST ===== */
article.single-post { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 44px; }

@media (max-width: 680px) { article.single-post { padding: 24px 18px; } }

.post-header { margin-bottom: 28px; border-bottom: 2px solid var(--border); padding-bottom: 24px; }

.post-header .entry-category {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.post-header .entry-title { font-size: 2.1rem; margin-bottom: 14px; line-height: 1.25; }

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
  font-family: var(--font-ui);
  color: var(--text-muted);
}

.entry-meta .updated { font-weight: 600; color: var(--primary-light); }

/* Thumbnail */
.post-featured-image {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  max-height: 420px;
}

.post-featured-image img { width: 100%; object-fit: cover; }

/* Content */
.entry-content h2 { font-size: 1.55rem; margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.entry-content h3 { font-size: 1.25rem; margin: 28px 0 12px; }
.entry-content p { margin-bottom: 1.3em; }
.entry-content ul, .entry-content ol { margin: 0 0 1.3em 1.6em; }
.entry-content li { margin-bottom: 0.5em; }
.entry-content blockquote {
  border-left: 4px solid var(--accent);
  margin: 24px 0;
  padding: 14px 20px;
  background: #fff8f7;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--primary);
}

.entry-content a { border-bottom: 1px solid var(--accent-light); }
.entry-content a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Step boxes */
.step-box {
  background: linear-gradient(135deg, #eef5ff, #f8faff);
  border: 1px solid #c8daf7;
  border-left: 4px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 20px 0;
}

.step-box .step-number {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.step-box h4 { font-size: 1rem; margin-bottom: 6px; }
.step-box p { font-size: 0.93rem; margin: 0; }

/* Info box */
.info-box {
  background: #fffbea;
  border: 1px solid #f7e08a;
  border-left: 4px solid #f0c100;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.93rem;
}

/* Warning box */
.warning-box {
  background: #fff3f0;
  border: 1px solid #fcc;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.93rem;
}

/* In-content Ad */
.in-content-ad {
  margin: 32px 0;
  text-align: center;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 100px;
}

.in-content-ad .ad-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Related posts */
.related-posts {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 2px solid var(--border);
}

.related-posts h3 { font-size: 1.35rem; margin-bottom: 20px; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 680px) { .related-grid { grid-template-columns: 1fr; } }

.related-card {
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 16px;
  transition: border-color 0.2s;
}

.related-card:hover { border-color: var(--primary-light); }
.related-card h4 { font-size: 0.95rem; margin-bottom: 6px; line-height: 1.4; }
.related-card h4 a { color: var(--primary); }
.related-card h4 a:hover { color: var(--accent); }
.related-card p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

/* Post tags */
.post-tags {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags a {
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.2s;
}

.post-tags a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== SIDEBAR ===== */
#secondary { position: relative; }

.widget {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px;
  margin-bottom: 24px;
}

.widget-title {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

/* Search widget */
.widget-search form { display: flex; gap: 6px; }
.widget-search input[type="search"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
}

.widget-search button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  transition: background 0.2s;
}

.widget-search button:hover { background: var(--primary-light); }

/* Recent posts widget */
.recent-posts-list { list-style: none; }
.recent-posts-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.recent-posts-list li:last-child { border-bottom: none; padding-bottom: 0; }
.recent-posts-list .thumb { width: 60px; height: 50px; border-radius: 5px; overflow: hidden; flex-shrink: 0; background: var(--border); }
.recent-posts-list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-posts-list .info a { font-family: var(--font-ui); font-size: 0.85rem; font-weight: 500; color: var(--primary); line-height: 1.35; display: block; }
.recent-posts-list .info a:hover { color: var(--accent); }
.recent-posts-list .info .date { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* Categories widget */
.categories-list { list-style: none; }
.categories-list li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.categories-list li:last-child { border-bottom: none; }
.categories-list a {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  transition: color 0.2s;
}

.categories-list a:hover { color: var(--accent); }
.categories-list .count {
  background: var(--sidebar-bg);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Sidebar ad widget */
.sidebar-ad {
  text-align: center;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px dashed var(--border);
}

/* Sticky sidebar */
.sticky-sidebar { position: sticky; top: 80px; }

/* ===== FOOTER ===== */
#colophon {
  background: var(--primary);
  color: rgba(255,255,255,0.8);
  padding: 48px 20px 0;
  margin-top: 60px;
}

.footer-widgets {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

@media (max-width: 800px) { .footer-widgets { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-widgets { grid-template-columns: 1fr; } }

.footer-col h4 {
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.footer-col p { font-size: 0.88rem; line-height: 1.7; }

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: rgba(255,255,255,0.7); font-size: 0.88rem; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--accent-light); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 16px 0;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-family: var(--font-ui);
  flex-wrap: wrap;
  gap: 10px;
}

.footer-bottom a { color: rgba(255,255,255,0.6); }
.footer-bottom a:hover { color: var(--accent-light); }

/* ===== UTILITIES ===== */
.screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  position: absolute;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.skip-link { position: absolute; top: -100px; left: 0; background: var(--accent); color: #fff; padding: 8px 16px; z-index: 9999; transition: top 0.2s; }
.skip-link:focus { top: 0; }
