/*
Theme Name: UsefulWrites Medium
Description: Professional Medium-style dark theme (stable & branded)
Author: Zubair Shaikh 
Version: 1.7
Text Domain: usefulwrites-medium
*/

/* ======================
   VARIABLES
   ====================== */
:root {
    --bg-primary: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    --bg-secondary: rgba(255,255,255,0.035);
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --accent: #38bdf8;
    --border: rgba(255,255,255,0.08);
    --shadow-soft: 0 8px 24px rgba(0,0,0,.4);
}

/* ======================
   GLOBAL RESET
   ====================== */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
}

/* ======================
   LINKS
   ====================== */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color .2s ease, opacity .2s ease;
}
a:hover {
    color: #7dd3fc;
    opacity: .95;
}

/* ======================
   HEADER
   ====================== */
.uw-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(2,6,23,.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.uw-header-inner {
    max-width: 1200px;
    margin: auto;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* LOGO – CLEAN & PROFESSIONAL */
.uw-logo {
    font-family: "Lora", serif;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: relative;
    display: inline-block;

    background: linear-gradient(
        90deg,
        #ffffff 0%,
        #f8fafc 30%,
        #38bdf8 70%,
        #0ea5e9 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    transition: letter-spacing 0.3s ease, text-shadow 0.3s ease;
}

/* Desktop-only refinement */
@media (hover: hover) {
    .uw-logo {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    }

    .uw-logo:hover {
        letter-spacing: 0.12em;
        text-shadow: 0 1px 3px rgba(56, 189, 248, 0.25);
    }
}

/* Refined subtle brand underline */
.uw-logo::after {
    content: "";
    display: block;
    width: 3.5em;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--accent) 50%,
        transparent 100%
    );
    margin-top: 0.4em;
    border-radius: 1px;
    transition: width 0.3s ease;
}

@media (hover: hover) {
    .uw-logo:hover::after {
        width: 4.5em;
    }
}
/* HEADER ACTIONS */
.uw-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.uw-header-actions a {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: .9rem;
    white-space: nowrap;
    transition: all .25s ease;
}

.uw-header-actions a:hover {
    background: var(--accent);
    color: #020617;
    box-shadow: var(--shadow-soft);
}

/* ======================
   PROFILE DROPDOWN
   ====================== */
.uw-profile {
    position: relative;
    display: flex;
    align-items: center;
}

.uw-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    cursor: pointer;
}

.uw-profile-menu {
    position: absolute;
    right: 0;
    top: 44px;
    background: rgba(2,6,23,.95);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    min-width: 160px;
    display: none;
    box-shadow: var(--shadow-soft);
}

.uw-profile-menu a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-secondary);
}

.uw-profile-menu a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.uw-profile:hover .uw-profile-menu { display: block; }

/* ======================
   POST LIST
   ====================== */
.uw-post-list {
    max-width: 820px;
    margin: 3rem auto;
    padding: 0 1.25rem;
}

.uw-post-card {
    background: var(--bg-secondary);
    border-radius: 18px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease;
}

.uw-post-card:hover { transform: translateY(-2px); }

.uw-post-card img {
    width: 100%;
    height: auto;
    border-radius: 14px;
    margin-bottom: 1.5rem;
}

.uw-post-title {
    font-family: "Lora", serif;
    font-size: 1.6rem;
    margin-bottom: .8rem;
}

/* ======================
   SINGLE POST
   ====================== */
.uw-single-viewport {
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

.uw-single-column {
    width: 100%;
    max-width: 740px;
    padding: 0 20px;
}

.uw-single-title {
    font-family: "Lora", serif;
    font-size: 2rem;
    line-height: 1.25;
    margin: 2rem 0 1.5rem;
}

.uw-featured-media img {
    width: 100%;
    height: auto;
    border-radius: 18px;
    margin: 2rem 0;
}

/* CONTENT */
.uw-single-content-wrap { overflow-x: hidden; }

.uw-single-content-wrap p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #d1d5db;
    margin: 1.6rem 0;
}

.uw-single-content-wrap img,
.uw-single-content-wrap iframe,
.uw-single-content-wrap video {
    max-width: 100%;
    height: auto;
}

/* STOP GUTENBERG WIDTH */
.uw-single-content-wrap .alignwide,
.uw-single-content-wrap .alignfull {
    width: 100% !important;
    margin: 0 !important;
}

/* ======================
   AUTHOR BOX
   ====================== */
.uw-author-box {
    display: flex;
    gap: 16px;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.uw-author-box img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

.uw-author-box p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: .95rem;
}

/* ======================
   APP-LIKE FOOTER NAV
   ====================== */
.uw-bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(15,23,42,.92);
    backdrop-filter: blur(20px);
    border-radius: 22px;
    padding: 10px 8px;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    z-index: 999;
}

.uw-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 16px;
    font-size: .75rem;
    color: var(--text-secondary);
    transition: all .25s ease;
}

.uw-bottom-item .uw-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.uw-bottom-item:hover,
.uw-bottom-item.uw-active {
    background: rgba(56,189,248,.18);
    color: var(--accent);
}

/* hide on desktop */
@media (min-width: 769px) {
    .uw-bottom-nav { display: none; }
}

/* ======================
   FOOTER (STATIC)
   ====================== */
.site-footer {
    text-align: center;
    padding: 2.5rem 1rem 5rem;
    margin-top: 5rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: .9rem;
}

/* ======================
   MOBILE POLISH
   ====================== */
@media (max-width: 768px) {
    .uw-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .uw-logo { font-size: 1.4rem; }
}
/* ================================
   PREMIUM READING TYPOGRAPHY (ADD-ON)
   Medium se better reading experience
================================ */

/* BODY READING UPGRADE */
body {
    font-size: 18px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* SINGLE POST WIDTH REFINEMENT */
.uw-single-column {
    max-width: 700px; /* slightly tighter than before */
}

/* ARTICLE TITLE – MORE AUTHORITY */
.uw-single-title {
    font-family: "Libre Baskerville", "Lora", Georgia, serif;
    font-size: 2.25rem;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

/* CONTENT PARAGRAPHS – READING COMFORT */
.uw-single-content-wrap p {
    font-size: 1.125rem;
    line-height: 1.85;
    margin: 1.8rem 0;
    color: #e5e7eb;
}

/* SUBHEADINGS – CLEAR VISUAL HIERARCHY */
.uw-single-content-wrap h2 {
    font-family: "Libre Baskerville", "Lora", Georgia, serif;
    font-size: 1.6rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.uw-single-content-wrap h3 {
    font-family: "Libre Baskerville", "Lora", Georgia, serif;
    font-size: 1.3rem;
    margin-top: 2.2rem;
    margin-bottom: .8rem;
}

/* LINKS – SUBTLE PREMIUM STYLE */
.uw-single-content-wrap a {
    color: #7dd3fc;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.uw-single-content-wrap a:hover {
    color: #bae6fd;
}

/* ARTICLE CARD TITLE POLISH (HOMEPAGE) */
.uw-post-title {
    font-family: "Libre Baskerville", "Lora", Georgia, serif;
    letter-spacing: -0.01em;
}

/* MOBILE READING OPTIMIZATION */
@media (max-width: 768px) {
    body {
        font-size: 17px;
    }

    .uw-single-title {
        font-size: 1.95rem;
    }

    .uw-single-content-wrap p {
        font-size: 1.05rem;
        line-height: 1.8;
    }
}
/* =========================
   READING PROGRESS BAR
========================= */

#uw-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(
        90deg,
        #38bdf8,
        #7dd3fc
    );
    z-index: 9999;
    transition: width 0.12s linear;
}

/* Mobile thoda thicker */
@media (max-width: 768px) {
    #uw-reading-progress {
        height: 4px;
    }
}
.uw-trust-box {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 15px;
  line-height: 1.6;
  color: #cfcfcf;
}

.uw-trust-title {
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-bottom: 8px;
  font-weight: 600;
}

.uw-trust-bio {
  margin-bottom: 6px;
}

.uw-trust-line {
  font-style: italic;
  color: #a5a5a5;
  margin-bottom: 8px;
}

.uw-disclaimer {
  font-size: 13px;
  color: #8c8c8c;
  margin-top: 10px;
}
.uw-editors-pick-label {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.3px;
  opacity: 0.7;
  margin-bottom: 6px;
}
/* HERO */
.uw-hero-card img{
border-radius:14px;
}

/* CATEGORY SLIDER */
.uw-category-slider{
display:flex;
overflow-x:auto;
gap:10px;
padding:12px 10px;
}
.uw-category-slider a{
flex:0 0 auto;
background:#132238;
padding:8px 14px;
border-radius:20px;
color:#4fc3ff;
font-size:14px;
white-space:nowrap;
}

/* CATEGORY PILLS IN POSTS */
.uw-category a{
background:#132238;
padding:5px 10px;
border-radius:20px;
font-size:13px;
margin-right:5px;
display:inline-block;
color:#4fc3ff;
}

/* TRENDING */
.uw-trending-grid{
display:grid;
grid-template-columns:repeat(2,1fr);
gap:12px;
}
.uw-trending-card img{
width:100%;
border-radius:12px;
}
.uw-trending-card h3{
font-size:15px;
}

/* EDITORS PICKS */
.uw-editors-pick-card img{
border-radius:12px;
}

/* MOBILE LOGO FIX */
@media(max-width:768px){
.site-logo img,
.custom-logo{
filter:brightness(1.2) contrast(1.1);
}
.uw-trending-grid{
grid-template-columns:1fr;
}
}
header ul,
header .menu,
header .categories{
  display:none !important;
}
/* HEADER */
.uw-header{
position:sticky;
top:0;
background:#0b1220;
z-index:1000;
}

.uw-header-inner{
display:flex;
align-items:center;
justify-content:space-between;
padding:14px 16px;
}

.uw-logo{
color:#ffffff;
font-size:22px;
font-weight:700;
text-decoration:none;
}

.uw-logo-accent{
color:#4fc3ff;
}

.uw-btn-primary{
background:#4fc3ff;
color:#000;
padding:7px 14px;
border-radius:20px;
text-decoration:none;
font-size:14px;
}

/* HAMBURGER */
.uw-menu-toggle{
background:none;
border:none;
font-size:26px;
color:#fff;
cursor:pointer;
}

/* SIDE MENU */
.uw-side-menu{
position:fixed;
top:0;
left:-270px;
width:270px;
height:100vh;
background:#0b1220;
z-index:2000;
transition:.3s;
overflow-y:auto;
}

.uw-side-menu.open{
left:0;
}

.uw-side-inner{
padding:20px;
}

.uw-side-inner h3{
color:#4fc3ff;
margin:20px 0 10px;
font-size:16px;
}

.uw-side-inner ul{
list-style:none;
padding:0;
margin:0;
}

.uw-side-inner li{
margin-bottom:12px;
}

.uw-side-inner a{
color:#cfd8ff;
text-decoration:none;
font-size:15px;
}

/* DESKTOP */
@media(min-width:992px){
.uw-menu-toggle{display:none;}
}
.uw-menu-close{
background:none;
border:none;
color:#fff;
font-size:22px;
position:absolute;
top:12px;
right:15px;
cursor:pointer;
}
/* SEARCH BOX */
.uw-header-search{
position:relative;
max-width:260px;
width:100%;
}

.uw-header-search form{
display:flex;
background:#0e1a2f;
border-radius:30px;
overflow:hidden;
}

.uw-header-search input{
flex:1;
background:transparent;
border:none;
padding:10px 14px;
color:#fff;
font-size:14px;
outline:none;
}

.uw-header-search button{
background:#1ec8ff;
border:none;
padding:0 14px;
cursor:pointer;
font-size:16px;
}

/* Suggestions Box */
#uw-search-results{
position:absolute;
top:45px;
left:0;
width:100%;
background:#0b1220;
border-radius:12px;
max-height:260px;
overflow-y:auto;
display:none;
z-index:9999;
box-shadow:0 10px 30px rgba(0,0,0,.4);
}

#uw-search-results a{
display:block;
padding:10px 12px;
color:#9fdcff;
text-decoration:none;
border-bottom:1px solid rgba(255,255,255,.05);
}

#uw-search-results a:hover{
background:#132347;
}
/* FORCE EDITORS PICKS THUMBNAILS */

.uw-editors-pick-card img{
display:block !important;
width:100% !important;
height:auto !important;
visibility:visible !important;
opacity:1 !important;
}
.uw-editors-picks-grid{
display:grid;
grid-template-columns:repeat(2,1fr);
gap:14px;
}
