/*
Theme Name: IAS Valley Blog
Theme URI: https://blog.iasvalley.com/
Author: IAS Valley
Description: Toppers' stories, strategy and write-ups in the IAS Valley look, with the shared IAS Valley sign-in and a Share your story form.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: iasvalley-blog
*/

/* The same colours, faces and header as iasvalley.com: olive on everything that acts, gold for
   highlights under dark text, Roboto Condensed headings, Mukta body. Mukta sits high in fixed-height
   controls, so those get a little top padding (2px at 16px, 1px at 13 to 15px). */
:root{
  --olive:#5c5608; --olive-dark:#454005; --olive-deep:#2b2805; --olive-soft:#edefdc; --olive-line:#d6dab4;
  --gold:#fec600; --gold-dark:#e6b300; --gold-soft:#fff6d9; --gold-ink:#7a5c00;
  --ink:#151a30; --ink-2:#3d4152; --mute:#5f6368; --hair:#e2e4e8;
  --paper:#f7f6f2; --on-deep:#ecead3; --on-deep-mute:#c9c59c;
  --display:"Roboto Condensed","Arial Narrow",Arial,sans-serif;
  --body:"Mukta",-apple-system,system-ui,"Segoe UI",Roboto,Arial,sans-serif;
  --top-h:72px;
}
*{box-sizing:border-box}
body{margin:0; background:var(--paper); color:var(--ink); font-family:var(--body); font-size:17px; line-height:1.55; -webkit-font-smoothing:antialiased}
img{max-width:100%; height:auto; display:block}
a{color:var(--olive)}
[hidden]{display:none!important}
:focus-visible{outline:3px solid var(--gold-dark); outline-offset:2px; border-radius:6px}
h1,h2,h3{margin:0; font-family:var(--display); font-weight:700; line-height:1.08; color:var(--ink); text-wrap:balance}
p{margin:0}
.wrap{max-width:1180px; margin:0 auto; padding:0 24px}
.skip{position:absolute; left:-9999px; top:8px; z-index:200; background:#fff; padding:10px 14px; border-radius:8px}
.skip:focus{left:16px}
.sr, .screen-reader-text{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}
@media (prefers-reduced-motion:reduce){ *{transition:none!important} }

/* ---------- buttons ---------- */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; height:48px; padding:2px 22px 0; border-radius:999px;
  border:1.5px solid transparent; font:inherit; font-size:16px; font-weight:700; line-height:1; text-decoration:none; white-space:nowrap; cursor:pointer}
.btn-sm{height:40px; padding:0 18px; font-size:15px}
.btn-primary{background:var(--olive); color:#fff}
.btn-primary:hover{background:var(--olive-dark)}
.btn-primary:disabled{opacity:.7; cursor:default}
.btn-ghost{background:transparent; color:var(--ink); border-color:var(--olive-line)}
.btn-ghost:hover{border-color:var(--olive); background:#fff}
.btn-dark{background:var(--ink); color:#fff}
.btn-dark:hover{background:#262c48}
.kicker{margin-bottom:10px; font-family:var(--display); font-size:14px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--olive); line-height:1.2}
.tag{align-self:flex-start; display:inline-flex; align-items:center; height:28px; padding:1px 12px 0; border-radius:999px; background:var(--olive-soft); color:var(--olive-dark); font-size:14px; font-weight:700; line-height:1; text-decoration:none; white-space:nowrap}

/* ---------- header ---------- */
.top{position:sticky; top:0; z-index:60; background:rgba(247,246,242,.95); backdrop-filter:saturate(140%) blur(10px); border-bottom:1px solid var(--hair)}
.admin-bar .top{top:32px}
.top-in{display:flex; align-items:center; gap:28px; height:var(--top-h)}
.brand{display:inline-flex; align-items:center; gap:10px; text-decoration:none; flex:none}
.brand-mark{display:grid; place-items:center; width:44px; height:44px; padding:8px; border-radius:50%; background:#fff; border:1px solid var(--olive-line)}
.brand-mark img{width:100%; height:100%; object-fit:contain}
.brand-name{font-family:var(--display); font-weight:700; font-size:23px; line-height:1; letter-spacing:.02em; text-transform:uppercase; color:var(--olive)}
.nav{display:flex; align-items:center; gap:2px; margin-right:auto}
.nav a{display:inline-flex; align-items:center; height:40px; padding:2px 12px 0; border-radius:8px; color:var(--ink-2); font-size:16px; font-weight:500; line-height:1; text-decoration:none}
.nav a:hover{background:var(--olive-soft); color:var(--ink)}
.nav a[aria-current="page"]{background:var(--olive-soft); color:var(--olive-dark); font-weight:700}
.account{display:flex; align-items:center; gap:10px}
.acct{position:relative}
.acct-btn{display:inline-flex; align-items:center; gap:10px; height:44px; padding:0 14px 0 5px; border-radius:999px; border:1.5px solid var(--olive-line);
  background:#fff; color:var(--ink); font:inherit; font-size:15px; font-weight:700; line-height:1; cursor:pointer}
.acct-btn:hover{border-color:var(--olive)}
.acct-initial{display:grid; place-items:center; width:32px; height:32px; padding-top:1px; border-radius:50%; background:var(--gold); color:var(--ink); font-family:var(--display); font-size:16px; font-weight:700; line-height:1}
.chev{display:block; width:12px; height:12px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; transition:transform .15s ease}
.acct-btn[aria-expanded="true"] .chev{transform:rotate(180deg)}
.acct-menu{position:absolute; right:0; top:calc(100% + 8px); width:270px; padding:8px; display:flex; flex-direction:column;
  background:#fff; border:1px solid var(--hair); border-radius:14px; box-shadow:0 14px 36px rgba(21,26,48,.14)}
.acct-who{display:flex; flex-direction:column; gap:2px; padding:10px 12px 12px; line-height:1.3}
.acct-who b{font-size:16px}
.acct-who span{font-size:14px; color:var(--mute); overflow-wrap:anywhere}
.acct-who span:empty{display:none}
.acct-menu a, .acct-menu button{display:flex; align-items:center; height:42px; padding:2px 12px 0; border-radius:8px; border:0; background:none;
  color:var(--ink); font:inherit; font-size:16px; line-height:1; text-align:left; text-decoration:none; cursor:pointer}
.acct-menu a:hover, .acct-menu button:hover{background:var(--olive-soft)}
.acct-sep{height:1px; margin:6px 4px; background:var(--hair)}
.acct-out{color:#a32d1c!important}
.menu-btn{display:none; place-items:center; width:44px; height:44px; padding:0; border-radius:12px; border:1.5px solid var(--olive-line); background:#fff; color:var(--ink); cursor:pointer}
.menu-btn svg{display:block; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round}
.drawer{position:fixed; inset:0; z-index:90; overflow-y:auto; padding:0 20px 32px; background:var(--paper)}
.drawer-top{display:flex; align-items:center; justify-content:space-between; height:var(--top-h)}
.drawer-top .menu-btn{display:grid}
.drawer-nav{display:flex; flex-direction:column; margin-top:8px}
.drawer-nav a{display:flex; align-items:center; height:56px; border-bottom:1px solid var(--olive-line); color:var(--ink); font-family:var(--display); font-size:22px; font-weight:700; line-height:1; text-decoration:none}
.drawer-account{margin-top:24px}
.drawer-account .btn{width:100%}
.drawer-acct{display:flex; flex-direction:column; background:#fff; border:1px solid var(--hair); border-radius:14px; padding:8px}
.drawer-acct a, .drawer-acct button{display:flex; align-items:center; height:48px; padding:2px 12px 0; border:0; border-radius:8px; background:none; color:var(--ink); font:inherit; font-size:17px; line-height:1; text-align:left; text-decoration:none; cursor:pointer}

/* ---------- blog home and categories ---------- */
.blog-head{padding-top:56px; background:#fff; border-bottom:1px solid var(--hair)}
.blog-head-in{display:flex; align-items:flex-end; justify-content:space-between; gap:24px; flex-wrap:wrap}
.blog-head-copy{max-width:760px}
.blog-head h1{font-size:clamp(34px,4vw,52px)}
.blog-lede{margin-top:12px; font-size:19px; color:var(--ink-2)}
.cat-tabs{display:flex; gap:4px; margin-top:28px; overflow-x:auto; scrollbar-width:none}
.cat-tabs::-webkit-scrollbar{display:none}
.cat-tabs a{flex:none; display:inline-flex; align-items:center; height:50px; padding:2px 14px 0; border-bottom:3px solid transparent; color:var(--ink-2); font-size:16px; font-weight:700; line-height:1; text-decoration:none}
.cat-tabs a:first-child{padding-left:0}
.cat-tabs a:hover{color:var(--ink)}
.cat-tabs a[aria-current="page"]{border-bottom-color:var(--gold); color:var(--ink)}
.blog-head:not(:has(.cat-tabs)){padding-bottom:40px}

.posts-wrap{padding-top:40px; padding-bottom:80px}
.post-grid{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px}
.post{display:flex; min-width:0}
.post-link{display:flex; flex:1; flex-direction:column; overflow:hidden; background:#fff; border:1px solid var(--hair); border-radius:16px; color:var(--ink); text-decoration:none}
.post-link:hover{border-color:var(--olive)}
.post-cover{aspect-ratio:16 / 9; background:var(--olive-soft); border-bottom:1px solid var(--hair)}
.post-cover img{width:100%; height:100%; object-fit:cover}
.post-body{display:flex; flex:1; flex-direction:column; align-items:flex-start; gap:10px; padding:22px 24px 24px}
.post h2{font-size:24px; line-height:1.15}
.post p{display:-webkit-box; overflow:hidden; -webkit-line-clamp:3; -webkit-box-orient:vertical; color:var(--ink-2); font-size:16px}
.post-meta{margin-top:auto; padding-top:4px; color:var(--mute); font-size:14px; line-height:1.3}
.empty{max-width:36em; padding:24px 0 48px}
.empty h2{font-size:28px}
.empty p{margin-top:10px; color:var(--ink-2)}

.pagination{margin-top:36px}
.nav-links{display:flex; flex-wrap:wrap; gap:6px}
.page-numbers{display:inline-flex; align-items:center; justify-content:center; min-width:44px; height:44px; padding:2px 14px 0; border:1.5px solid var(--olive-line); border-radius:999px;
  background:#fff; color:var(--ink); font-size:16px; font-weight:700; line-height:1; text-decoration:none}
a.page-numbers:hover{border-color:var(--olive)}
.page-numbers.current{background:var(--olive); border-color:var(--olive); color:#fff}
.page-numbers.dots{border-color:transparent; background:none}

/* ---------- a post ---------- */
.single{padding-top:48px}
.entry{max-width:760px; margin:0 auto; padding:0 24px 64px}
.entry-kicker{display:flex; gap:8px; margin-bottom:16px}
.entry-kicker:empty{display:none}
.entry-title{font-size:clamp(34px,4.2vw,50px); line-height:1.08}
.entry-meta{display:flex; flex-wrap:wrap; align-items:center; margin-top:18px; color:var(--mute); font-size:16px; line-height:1.3}
.entry-meta span + span{margin-left:12px; padding-left:12px; border-left:1px solid var(--olive-line)}
.entry-cover{margin:32px 0 0}
.entry-cover img{width:100%; border-radius:16px}
.prose{margin-top:32px; font-size:19px; line-height:1.75; color:#2b3044}
.prose > *{margin:0}
.prose > * + *{margin-top:1.1em}
.prose h2{margin-top:1.8em; font-size:30px; line-height:1.15}
.prose h3{margin-top:1.6em; font-size:24px; line-height:1.2}
.prose h2 + *, .prose h3 + *{margin-top:.6em}
.prose ul, .prose ol{padding-left:1.3em}
.prose li + li{margin-top:.45em}
.prose li::marker{color:var(--olive)}
.prose a{text-underline-offset:3px}
.prose blockquote{padding:4px 0 4px 20px; border-left:3px solid var(--gold); color:var(--ink-2); font-size:21px}
.prose img{border-radius:12px}
.prose figcaption{margin-top:8px; color:var(--mute); font-size:15px}
.prose table{display:block; overflow-x:auto; border-collapse:collapse; font-size:17px}
.prose th, .prose td{padding:8px 12px; border:1px solid var(--hair); text-align:left; vertical-align:top}
.aligncenter{margin-left:auto; margin-right:auto}
.entry-source{margin-top:28px; color:var(--mute); font-size:16px}

.share-band{padding:40px 0; background:var(--gold)}
.share-band-in{display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap; max-width:1180px; margin:0 auto; padding:0 24px}
.share-band h2{font-size:30px}
.share-band p{margin-top:6px; color:var(--ink); font-size:17px}
.more{padding-top:56px; padding-bottom:80px}
.more > h2{margin-bottom:22px; font-size:30px}

/* ---------- share your story ---------- */
.share-lede{margin-top:16px; font-size:19px; color:var(--ink-2)}
.share-gate, .share-done{margin-top:32px; padding:28px; background:#fff; border:1px solid var(--hair); border-radius:16px}
.share-gate h2, .share-done h2{font-size:26px}
.share-gate p, .share-done p{margin-top:8px; color:var(--ink-2)}
.share-gate .btn, .share-done .btn{margin-top:18px}
.share-done:focus{outline:none}
.share-form{display:flex; flex-direction:column; gap:20px; margin-top:32px}
.share-who{color:var(--mute); font-size:16px}
.share-who b{color:var(--ink)}
.field{display:flex; flex-direction:column; gap:8px; min-width:0}
.field label{font-size:16px; font-weight:700; line-height:1.2}
.optional{margin-left:6px; color:var(--mute); font-weight:500}
.field input, .field select{width:100%; height:48px; margin:0; padding:2px 14px 0; border:1.5px solid var(--olive-line); border-radius:12px; background:#fff; color:var(--ink); font:inherit; font-size:17px; line-height:1}
.field select{appearance:none; -webkit-appearance:none; padding-right:40px; cursor:pointer;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23151a30' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 15px center / 12px 12px}
.field textarea{display:block; width:100%; min-height:300px; margin:0; padding:12px 14px; border:1.5px solid var(--olive-line); border-radius:12px; background:#fff; color:var(--ink); font:inherit; font-size:17px; line-height:1.6; resize:vertical}
.field input:focus, .field select:focus, .field textarea:focus{outline:none; border-color:var(--olive); box-shadow:0 0 0 3px rgba(92,86,8,.14)}
.field-row{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px}
.hint{color:var(--mute); font-size:14px; line-height:1.3}
.check{display:flex; align-items:flex-start; gap:12px; font-size:16px; line-height:1.45; cursor:pointer}
.check input{flex:none; width:20px; height:20px; margin:1px 0 0; accent-color:var(--olive)}
.form-error{color:#a32d1c; font-size:16px; font-weight:500}
.form-error:empty{display:none}
.share-form > .btn{align-self:flex-start}
.empty-page > p{margin-top:12px; color:var(--ink-2)}

/* ---------- footer ---------- */
.foot{padding:56px 0 28px; background:var(--olive-deep); color:var(--on-deep-mute); font-size:16px}
.foot-grid{display:grid; grid-template-columns:minmax(0,1.4fr) repeat(3,minmax(0,1fr)); gap:32px}
.brand-light .brand-name{color:#fff}
.foot-brand p{margin-top:14px; max-width:30em}
.foot h2{margin-bottom:14px; font-size:15px; letter-spacing:.08em; text-transform:uppercase; color:var(--gold)}
.foot ul{display:flex; flex-direction:column; gap:10px; margin:0; padding:0; list-style:none}
.foot a{color:var(--on-deep); text-decoration:none}
.foot a:hover{color:#fff; text-decoration:underline; text-underline-offset:3px}
.foot-bottom{display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-top:44px; padding-top:22px; border-top:1px solid rgba(236,234,211,.18); font-size:15px}

/* ---------- tablets and phones ---------- */
@media (max-width:980px){
  :root{--top-h:64px}
  .top-in{gap:12px}
  .nav{display:none}
  .account{margin-left:auto}
  .menu-btn{display:grid}
  .acct-name{display:none}
  .acct-btn{padding:0 12px 0 5px}
  .post-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .foot-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:782px){ .admin-bar .top{top:46px} }
@media (max-width:640px){
  body{font-size:16px}
  .wrap, .entry, .share-band-in{padding-left:18px; padding-right:18px}
  .brand-mark{width:40px; height:40px; padding:7px}
  .brand-name{font-size:20px}
  .blog-head{padding-top:36px}
  .blog-lede, .share-lede{font-size:17px}
  .blog-head-in .btn{width:100%}
  .post-grid, .field-row, .foot-grid{grid-template-columns:minmax(0,1fr)}
  .post-body{padding:18px 18px 20px}
  .single{padding-top:32px}
  .prose{font-size:17px}
  .share-gate, .share-done{padding:22px}
  .share-form > .btn{align-self:stretch}
}
