/*
Theme Name: Webmastr
Theme URI: https://webmastr.net
Author: Tamer
Description: webmastr.net için "devtools" kimlikli, modüler kart sistemine sahip özel WordPress teması.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: webmastr
*/

/* ==========================================================================
   1. TOKENS
   ========================================================================== */
:root {
    --wm-ink: #14151A;
    --wm-ink-soft: #5B5E6B;
    --wm-paper: #F5F6F4;
    --wm-surface: #FFFFFF;
    --wm-signal: #4338CA;
    --wm-signal-hover: #362DB0;
    --wm-live: #00B67A;
    --wm-live-soft: #E4F9F0;
    --wm-line: #E3E4E0;
    --wm-signal-soft: #ECEBFB;

    --wm-dot-red: #FF5F57;
    --wm-dot-amber: #FEBC2E;
    --wm-dot-green: #28C840;

    --wm-font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --wm-font-body: 'Inter', 'Segoe UI', sans-serif;
    --wm-font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

    --wm-radius: 14px;
    --wm-radius-sm: 8px;
    --wm-shadow: 0 1px 2px rgba(20,21,26,.04), 0 8px 24px rgba(20,21,26,.05);
    --wm-shadow-hover: 0 4px 10px rgba(20,21,26,.06), 0 20px 40px rgba(20,21,26,.10);
    --wm-container: 1220px;
    --wm-ease: cubic-bezier(.2,.8,.2,1);
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--wm-font-body);
    color: var(--wm-ink);
    background: var(--wm-paper);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
    font-family: var(--wm-font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.01em;
    margin: 0 0 .5em;
    color: var(--wm-ink);
}
:focus-visible { outline: 2px solid var(--wm-signal); outline-offset: 3px; border-radius: 4px; }
.wm-container { max-width: var(--wm-container); margin: 0 auto; padding: 0 24px; }
.wm-mono { font-family: var(--wm-font-mono); }

/* ==========================================================================
   3. CHROME BAR — tarayıcı penceresi taklidi (imza öğe)
   ========================================================================== */
.wm-chrome { background: var(--wm-ink); color: rgba(255,255,255,.55); }
.wm-chrome .wm-container { display: flex; align-items: center; gap: 18px; height: 42px; }
.wm-chrome-dots { display: flex; gap: 7px; flex-shrink: 0; }
.wm-chrome-dots span { width: 10px; height: 10px; border-radius: 50%; display: block; }
.wm-chrome-dots span:nth-child(1) { background: var(--wm-dot-red); }
.wm-chrome-dots span:nth-child(2) { background: var(--wm-dot-amber); }
.wm-chrome-dots span:nth-child(3) { background: var(--wm-dot-green); }

.wm-chrome-url {
    flex: 1; max-width: 460px;
    background: rgba(255,255,255,.07);
    border-radius: 20px;
    padding: 5px 16px;
    font-family: var(--wm-font-mono);
    font-size: 12px;
    text-align: center;
    color: rgba(255,255,255,.65);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.wm-chrome-url b { color: rgba(255,255,255,.9); font-weight: 500; }

.wm-chrome-status {
    margin-left: auto;
    display: flex; align-items: center; gap: 7px;
    font-family: var(--wm-font-mono);
    font-size: 11.5px;
    flex-shrink: 0;
}
.wm-chrome-status .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--wm-dot-green);
    box-shadow: 0 0 0 0 rgba(40,200,64,.5);
    animation: wm-pulse 2s infinite;
}
@keyframes wm-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(40,200,64,.45); }
    70%  { box-shadow: 0 0 0 6px rgba(40,200,64,0); }
    100% { box-shadow: 0 0 0 0 rgba(40,200,64,0); }
}

/* ==========================================================================
   4. HEADER
   ========================================================================== */
.wm-header { background: var(--wm-surface); border-bottom: 1px solid var(--wm-line); position: sticky; top: 0; z-index: 50; }
.wm-header .wm-container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.wm-logo { font-family: var(--wm-font-display); font-size: 21px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 2px; }
.wm-logo span { color: var(--wm-signal); }
.wm-logo::before {
    content: '</>';
    font-family: var(--wm-font-mono);
    font-size: 13px; font-weight: 500;
    color: var(--wm-signal);
    background: var(--wm-signal-soft);
    padding: 3px 6px; border-radius: 6px;
    margin-right: 9px;
}

.wm-primary-nav { display: flex; align-items: center; gap: 2px; }
.wm-primary-nav > ul { display: flex; gap: 2px; position: relative; }
.wm-primary-nav > ul > li { position: relative; }
.wm-primary-nav > ul > li > a {
    display: block; padding: 9px 14px;
    font-weight: 500; font-size: 14.5px;
    border-radius: 8px;
    transition: background .15s var(--wm-ease), color .15s var(--wm-ease);
}
.wm-primary-nav > ul > li > a:hover { background: var(--wm-signal-soft); color: var(--wm-signal); }

.wm-primary-nav .sub-menu {
    display: none; position: absolute; top: calc(100% + 8px); left: 0;
    min-width: 230px;
    background: var(--wm-surface);
    border: 1px solid var(--wm-line);
    border-radius: var(--wm-radius-sm);
    box-shadow: var(--wm-shadow-hover);
    padding: 8px;
}
.wm-primary-nav li:hover > .sub-menu { display: block; }
.wm-primary-nav .sub-menu li a { display: block; padding: 8px 10px; border-radius: 6px; font-size: 13.5px; font-weight: 500; }
.wm-primary-nav .sub-menu li a:hover { background: var(--wm-signal-soft); color: var(--wm-signal); }
.wm-primary-nav .sub-menu li a::before { content: '#'; font-family: var(--wm-font-mono); color: var(--wm-ink-soft); margin-right: 6px; }

.wm-header-actions { display: flex; align-items: center; gap: 8px; }
.wm-search-toggle {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--wm-line);
    background: transparent;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.wm-search-toggle:hover { background: var(--wm-paper); border-color: var(--wm-ink-soft); }
.wm-btn-cta {
    background: var(--wm-ink);
    color: #fff !important;
    padding: 10px 18px;
    border-radius: var(--wm-radius-sm);
    font-weight: 600; font-size: 13.5px;
    transition: background .15s var(--wm-ease), transform .15s var(--wm-ease);
    display: inline-flex; align-items: center; gap: 6px;
}
.wm-btn-cta::after { content: '→'; transition: transform .15s var(--wm-ease); }
.wm-btn-cta:hover { background: var(--wm-signal); transform: translateY(-1px); }
.wm-btn-cta:hover::after { transform: translateX(2px); }

.wm-menu-toggle { display: none; background: none; border: 0; cursor: pointer; color: var(--wm-ink); }

/* ==========================================================================
   5. BADGES
   ========================================================================== */
.wm-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--wm-signal-soft);
    color: var(--wm-signal);
    font-family: var(--wm-font-mono);
    font-size: 11px; font-weight: 500; letter-spacing: .01em;
    padding: 4px 10px 4px 8px;
    border-radius: 20px;
}
.wm-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.wm-badge--on-image { position: absolute; top: 14px; left: 14px; background: rgba(20,21,26,.72); color: #fff; backdrop-filter: blur(6px); }
.wm-path { font-family: var(--wm-font-mono); font-size: 11.5px; color: var(--wm-ink-soft); opacity: .85; }

/* ==========================================================================
   6. HERO
   ========================================================================== */
.wm-hero { padding: 44px 0 12px; }
.wm-hero-eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--wm-font-mono); font-size: 12.5px; color: var(--wm-ink-soft); margin-bottom: 14px; }
.wm-hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--wm-live); }
.wm-cursor { display: inline-block; width: 2px; height: 14px; background: var(--wm-signal); margin-left: 2px; animation: wm-blink 1.1s step-end infinite; vertical-align: middle; }
@keyframes wm-blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.wm-hero-heading { font-size: clamp(30px, 4vw, 46px); max-width: 720px; margin-bottom: 32px; }
.wm-hero-heading em { font-style: normal; color: var(--wm-signal); }

.wm-hero-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: auto auto; gap: 18px; }
.wm-hero-main { grid-row: span 2; }
.wm-hero-card {
    position: relative;
    border-radius: var(--wm-radius);
    overflow: hidden;
    background: var(--wm-surface);
    border: 1px solid var(--wm-line);
    transition: box-shadow .25s var(--wm-ease), transform .25s var(--wm-ease), border-color .25s;
}
.wm-hero-card:hover { box-shadow: var(--wm-shadow-hover); transform: translateY(-3px); border-color: transparent; }
.wm-hero-card .wm-thumb-wrap { position: relative; overflow: hidden; }
.wm-hero-card img { aspect-ratio: 16/10; object-fit: cover; width: 100%; transition: transform .5s var(--wm-ease); }
.wm-hero-main img { aspect-ratio: 16/12; }
.wm-hero-card:hover img { transform: scale(1.045); }
.wm-hero-card .wm-card-body { padding: 18px; }
.wm-hero-main .wm-card-body h2 { font-size: 23px; }
.wm-hero-card h3, .wm-hero-card h2 { font-size: 16px; transition: color .15s; }
.wm-hero-card a.wm-card-title-link:hover h2,
.wm-hero-card a.wm-card-title-link:hover h3 { color: var(--wm-signal); }

.wm-meta { font-family: var(--wm-font-mono); font-size: 11.5px; color: var(--wm-ink-soft); display: flex; gap: 8px; align-items: center; margin-top: 8px; }

/* ==========================================================================
   7. LAYOUT
   ========================================================================== */
.wm-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; padding: 40px 0; align-items: start; }
.wm-section { margin-bottom: 48px; }
.wm-section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.wm-section-title .wm-eyebrow { display: block; font-family: var(--wm-font-mono); font-size: 11px; color: var(--wm-signal); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.wm-section-title h2 { font-size: 21px; margin: 0; }
.wm-section-title a { font-family: var(--wm-font-mono); font-size: 12px; font-weight: 500; color: var(--wm-ink-soft); transition: color .15s; white-space: nowrap; }
.wm-section-title a:hover { color: var(--wm-signal); }

.wm-post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.wm-post-card {
    background: var(--wm-surface);
    border: 1px solid var(--wm-line);
    border-radius: var(--wm-radius);
    overflow: hidden;
    transition: box-shadow .25s var(--wm-ease), transform .25s var(--wm-ease), border-color .25s;
}
.wm-post-card:hover { box-shadow: var(--wm-shadow-hover); transform: translateY(-3px); border-color: transparent; }
.wm-post-card .wm-thumb-wrap { overflow: hidden; }
.wm-post-card img { aspect-ratio: 16/10; object-fit: cover; transition: transform .5s var(--wm-ease); }
.wm-post-card:hover img { transform: scale(1.045); }
.wm-post-card .wm-card-body { padding: 16px; }
.wm-post-card h3 { font-size: 15.5px; margin: 10px 0 6px; transition: color .15s; }
.wm-post-card a:hover h3 { color: var(--wm-signal); }
.wm-post-card p { font-size: 13.5px; color: var(--wm-ink-soft); margin: 8px 0 0; line-height: 1.55; }

.wm-post-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--wm-line); }
.wm-post-row:last-child { border-bottom: none; }
.wm-post-row img { width: 80px; height: 60px; object-fit: cover; border-radius: var(--wm-radius-sm); flex-shrink: 0; }
.wm-post-row h4 { font-size: 13.5px; margin: 0 0 5px; font-weight: 600; transition: color .15s; }
.wm-post-row a:hover h4 { color: var(--wm-signal); }
.wm-post-row-rank { font-family: var(--wm-font-mono); font-size: 12px; color: var(--wm-ink-soft); width: 22px; flex-shrink: 0; padding-top: 2px; }

/* ==========================================================================
   8. SIDEBAR WIDGETS
   ========================================================================== */
.wm-widget { background: var(--wm-surface); border: 1px solid var(--wm-line); border-radius: var(--wm-radius); padding: 22px; margin-bottom: 20px; }
.wm-widget-title { font-family: var(--wm-font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--wm-ink-soft); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.wm-widget-title::before { content: '#'; color: var(--wm-signal); }

.wm-tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.wm-tag-list a {
    font-family: var(--wm-font-mono); font-size: 12px; font-weight: 500;
    padding: 6px 12px; border-radius: 20px;
    background: var(--wm-paper);
    border: 1px solid var(--wm-line);
    transition: background .15s, border-color .15s, color .15s;
}
.wm-tag-list a:hover { background: var(--wm-signal); border-color: var(--wm-signal); color: #fff; }

.wm-follow-stats { display: flex; flex-direction: column; gap: 8px; }
.wm-badge-pill { display: inline-flex; border-radius: 5px; overflow: hidden; font-family: var(--wm-font-mono); font-size: 12px; }
.wm-badge-pill-label { background: var(--wm-ink); color: rgba(255,255,255,.7); padding: 6px 10px; }
.wm-badge-pill-value { background: var(--wm-live); color: #fff; padding: 6px 10px; font-weight: 600; }
.wm-follow-stat { display: flex; align-items: center; justify-content: space-between; }

.wm-pop-categories li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--wm-line); font-size: 13.5px; font-weight: 500; }
.wm-pop-categories li:last-child { border-bottom: none; }
.wm-pop-categories a:hover { color: var(--wm-signal); }
.wm-pop-categories span { font-family: var(--wm-font-mono); color: var(--wm-ink-soft); font-size: 11.5px; background: var(--wm-paper); padding: 2px 7px; border-radius: 10px; }

.wm-ad-slot {
    background: repeating-linear-gradient(135deg, var(--wm-surface), var(--wm-surface) 10px, var(--wm-paper) 10px, var(--wm-paper) 20px);
    border: 1px dashed var(--wm-line);
    border-radius: var(--wm-radius);
    display: flex; align-items: center; justify-content: center;
    min-height: 250px;
    color: var(--wm-ink-soft);
    font-family: var(--wm-font-mono);
    font-size: 11px;
    margin-bottom: 20px;
    overflow: hidden;
}

/* ==========================================================================
   9. EDITOR'S CHOICE
   ========================================================================== */
.wm-editors-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.wm-author-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wm-author-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--wm-ink); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--wm-font-display);
    font-weight: 700; font-size: 13px;
}
.wm-author-group-head strong { font-size: 14px; }

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
.wm-footer { background: var(--wm-ink); color: #C9CBD4; padding: 52px 0 0; margin-top: 24px; }
.wm-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,.09); }
.wm-footer h4 { color: #fff; font-family: var(--wm-font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.wm-footer ul li { margin-bottom: 10px; font-size: 14px; }
.wm-footer ul li a { transition: color .15s; }
.wm-footer ul li a:hover { color: var(--wm-live); }
.wm-footer p { font-size: 13.5px; opacity: .7; max-width: 280px; line-height: 1.6; }

.wm-terminal-line { font-family: var(--wm-font-mono); font-size: 13px; color: rgba(255,255,255,.55); padding: 20px 0; display: flex; align-items: center; gap: 10px; }
.wm-terminal-line .prompt { color: var(--wm-live); }
.wm-terminal-line .wm-cursor { background: rgba(255,255,255,.55); }

/* ==========================================================================
   11. TEKİL YAZI
   ========================================================================== */
.wm-post-content { font-size: 17px; line-height: 1.8; }
.wm-post-content p { margin: 0 0 22px; }
.wm-post-content h2 { font-size: 26px; margin-top: 42px; }
.wm-post-content h3 { font-size: 21px; margin-top: 32px; }
.wm-post-content img { border-radius: var(--wm-radius); }
.wm-post-content code { font-family: var(--wm-font-mono); background: var(--wm-signal-soft); color: var(--wm-signal); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.wm-post-content pre { background: var(--wm-ink); color: #E4E5EA; padding: 20px; border-radius: var(--wm-radius-sm); overflow-x: auto; font-family: var(--wm-font-mono); font-size: 13.5px; line-height: 1.6; }
.wm-post-content pre code { background: none; color: inherit; padding: 0; }
.wm-post-content a { color: var(--wm-signal); text-decoration: underline; text-underline-offset: 3px; }
.wm-post-content blockquote { border-left: 3px solid var(--wm-signal); padding: 4px 0 4px 20px; margin: 28px 0; font-style: italic; color: var(--wm-ink-soft); }

/* ==========================================================================
   12. RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .wm-layout { grid-template-columns: 1fr; }
    .wm-hero-grid { grid-template-columns: 1fr 1fr; }
    .wm-hero-main { grid-column: span 2; }
    .wm-editors-choice { grid-template-columns: 1fr 1fr; }
    .wm-chrome-url { max-width: 300px; }
}
@media (max-width: 780px) {
    .wm-primary-nav { display: none; }
    .wm-menu-toggle { display: block; }
    .wm-hero-grid { grid-template-columns: 1fr; }
    .wm-hero-main { grid-column: span 1; }
    .wm-post-grid { grid-template-columns: 1fr; }
    .wm-footer-grid { grid-template-columns: 1fr 1fr; }
    .wm-editors-choice { grid-template-columns: 1fr; }
    .wm-chrome-url { display: none; }
    .wm-hero-heading { font-size: 28px; }
}
