/*
  desalasworks - modernised from the WordPress theme "Desalasworks 1.7"
  Same palette and structure, rebuilt on CSS grid with a fluid layout.
*/

:root {
  --ink: #333;
  --muted: #666;
  --accent: #cc0000;
  --accent-soft: #fccfc3;
  --dark: #120000;
  --dark-2: #220c0c;
  --dark-3: #472727;
  --page: #f5f5f5;
  --card: #fff;
  --line: #ccc;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  --wrap: 1000px;
  --font: "Trebuchet MS", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--page); line-height: 1.5; }
img { max-width: 100%; height: auto; border: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }

/* ---------------------------------------------------------------- header */

.site-header { background: var(--dark) url(../img/back-dark-gradient.gif) repeat-x 0 top; color: #fff; position: relative; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 30px 20px; }
.logo { font-size: 2.6rem; font-weight: bold; letter-spacing: -1px; color: #fff; line-height: 1.1; }
.logo:hover { text-decoration: none; }
.logo .presents { color: #ff0000; font-size: 40%; letter-spacing: 0; margin-left: 5px; }
.description { margin: 4px 0 0; font-size: 1.2rem; font-weight: bold; color: #d6bfbf; }

.nav ul { list-style: none; margin: 0; padding: 0; }
.nav > ul { display: flex; gap: 4px; }
.nav li { position: relative; }
.nav a { display: block; color: #fff; font-weight: bold; padding: 6px 15px; }
.nav a:hover { background: #683f3e; text-decoration: none; }
.nav .has-menu > ul {
  display: none; position: absolute; top: 100%; left: 0; min-width: 220px;
  background: var(--dark-3); border: 1px solid #683f3e; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.nav .has-menu:hover > ul, .nav .has-menu:focus-within > ul { display: block; }
.nav .has-menu:hover > a { background: var(--dark-3); }
.nav .has-menu li a { font-weight: normal; padding: 4px 15px; }

.menu-toggle {
  display: none; font-size: 1.8rem; line-height: 1; color: #fff; cursor: pointer;
  background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 2px; padding: 4px 14px;
}

/* ---------------------------------------------------------------- main */

.site-main { background: var(--page) url(../img/diag-bar.gif) repeat-x 0 top; padding-block: 54px 30px; min-height: 60vh; }

.section-title, .page-title { font-size: 2rem; color: var(--muted); margin: 0 0 15px; line-height: 1.2; font-weight: bold; }
.archive-title span { color: #bbb; }
.home-section { margin-bottom: 30px; }

.box { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 30px 40px; margin-bottom: 20px; }

/* ---------------------------------------------------------------- cards */

.cards { display: grid; gap: 30px; margin-bottom: 30px; }
.cards-large { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.cards-small { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }

.card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; font-size: 0.8rem; }
.card-large { box-shadow: 0 4px 12px #bbb; }
.card-thumb { display: block; border: 1px solid var(--line); background: #fff; overflow: hidden; aspect-ratio: 5 / 4; }
.card-small .card-thumb { aspect-ratio: 3 / 2; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center top; opacity: 0.92; transition: opacity 0.2s, transform 0.3s; }
.card-thumb:hover { border-color: #333; }
.card-thumb:hover img { opacity: 1; transform: scale(1.02); }
.card-title { margin: 10px 0 2px; font-size: 1.05em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-large .card-title { font-size: 1.4em; }
.card-title a { color: var(--ink); }
.card-cats { margin: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- articles grid on homepage */

.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 40px; }
.article-card { font-size: 0.85rem; }
.article-thumb { display: block; aspect-ratio: 2 / 1; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 0 4px 1px #ccc; margin-bottom: 15px; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card .card-title { text-align: left; white-space: normal; font-size: 1.3em; }
.article-card .meta { margin: 0 0 6px; color: var(--muted); font-style: italic; }
.article-card .excerpt { line-height: 1.5; }

/* ---------------------------------------------------------------- skills (tags) */

.skills { line-height: 2.1; margin: 0 0 15px; }
.skills a { padding: 2px 4px; border-bottom: 1px solid var(--accent); border-right: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); white-space: nowrap; font-size: 0.85em; }
.skills a:hover { text-decoration: none; background: #f9b8a7; }

/* ---------------------------------------------------------------- post + sidebar */

.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 30px; align-items: start; }
.post { font-size: 0.95rem; line-height: 1.6; }
.post .date { color: var(--muted); font-style: italic; margin-top: 0; }
.post-title { font-size: 1.5rem; margin: 0 0 10px; }
.post-title a { color: var(--ink); }
.entry h2, .entry h3, .entry h4 { line-height: 1.4; }
.entry img { height: auto; }
.entry li { margin-bottom: 8px; }
.entry code { background: #eee; padding: 1px 3px; }
.entry pre { overflow-x: auto; font-size: 0.85rem; background: #f8f8f8; padding: 12px; border: 1px solid #e5e5e5; }
.entry pre code { background: none; padding: 0; }
.entry iframe { max-width: 100%; }
.entry table { display: block; overflow-x: auto; }
.entry blockquote { font-size: 1.15em; font-style: italic; opacity: 0.65; margin: 0; padding: 5px 0 5px 40px; position: relative; }
.entry blockquote::before { content: "\201C"; position: absolute; left: 0; top: 0; font-size: 3em; line-height: 1; }

/* WordPress alignment / caption classes still used in imported content */
.alignleft { float: left; margin: 0 20px 10px 0; }
.alignright { float: right; margin: 0 0 10px 20px; }
.aligncenter { display: block; margin-inline: auto; }
.entry::after { content: ""; display: table; clear: both; }
.wp-caption { margin: 0 0 15px; max-width: 100%; }
.wp-caption.aligncenter { margin-inline: auto; }
.wp-caption-text { color: var(--muted); font-size: 0.85em; font-style: italic; margin-top: 4px; }

.sidebar { font-size: 0.8rem; }
.sidebar-box { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 12px; margin-bottom: 20px; margin-top: 52px; }
.sidebar-box h4 { margin: 0 0 8px; text-transform: uppercase; }
.sidebar-box ul { list-style: none; margin: 0; padding: 0; columns: 1; }
.sidebar-heading { margin: 0 0 12px 4px; font-size: 0.85rem; }
.sidebar-cards { display: grid; gap: 20px; }

.pagination { display: flex; justify-content: space-between; margin: 10px 0 30px; font-weight: bold; }
.pagination .newer { margin-left: auto; }

/* ---------------------------------------------------------------- comments */

.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment-list { margin: 10px 0 0 30px; }
.comment { margin-bottom: 12px; }
.comment-meta { font-size: 0.85em; color: var(--muted); margin-bottom: 4px; }
.comment-body { background: #f5f5f5; padding: 8px 14px; border-left: 3px solid var(--line); }
.comment.by-author > .comment-body { background: #ede0e0; border-left-color: var(--accent); }
.comment-body p { margin: 6px 0; }
.comments-closed { color: var(--muted); font-style: italic; margin-bottom: 0; }

/* ---------------------------------------------------------------- footer */

.site-footer { background: var(--dark) url(../img/diag-bar.gif) repeat-x 0 top; color: #fff; padding-block: 60px 80px; font-size: 0.9rem; }
.site-footer a { color: #fff; }
.profile { text-align: center; font-size: 1.4rem; }
.profile-pic { width: 160px; height: 160px; object-fit: cover; border-radius: 50%; border: 3px solid #fff; filter: grayscale(0.3); }
.profile h3 { margin: 0.5em 0 0.2em; }
.profile p { margin: 0; font-weight: bold; }
.footer-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 60px; margin-top: 30px; }
.site-footer h2 { font-size: 1.8rem; margin: 30px 0 10px; }
.availability { border: 1px solid #fff; padding: 5px 10px; font-weight: bold; text-align: center; background: #b4520a; border-radius: 10px; }
.blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 10px; }
.block { padding-left: 40px; min-height: 32px; line-height: 32px; margin-bottom: 15px; background-repeat: no-repeat; background-position: 0 0; }
.panel { margin-top: 5px; padding: 3px 10px 0; border-block: 1px dashed #fff; background: var(--dark-2); }
.association { display: flex; align-items: center; gap: 12px; margin: 0 0 30px; }
.association img { width: 75px; background: #fff; flex: none; }

.icon-linkedin { background-image: url(../img/icon-linkedin.png); }
.icon-telegram-sq { background-image: url(../img/icon-telegram-sq.png); }
.icon-whatsapp { background-image: url(../img/icon-whatsapp.png); }
.icon-email { background-image: url(../img/icon-email.gif); }
.icon-express { background-image: url(../img/icon-express.png); }
.icon-nodejs { background-image: url(../img/icon-nodejs.png); }
.icon-docker { background-image: url(../img/icon-docker.png); }
.icon-bash { background-image: url(../img/icon-bash.png); }
.icon-mongodb { background-image: url(../img/icon-mongodb.png); }
.icon-db { background-image: url(../img/icon-db.png); }
.icon-redis { background-image: url(../img/icon-redis.png); }
.icon-aws { background-image: url(../img/icon-aws.png); }
.icon-vuejs { background-image: url(../img/icon-vuejs.png); }
.icon-react { background-image: url(../img/icon-react.png); }
.icon-svelte { background-image: url(../img/icon-svelte.png); }
.icon-feeds { background-image: url(../img/icon-feeds.png); }
.icon-css { background-image: url(../img/icon-css.png); }
.icon-html { background-image: url(../img/icon-html.png); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .with-sidebar { grid-template-columns: 1fr; }
  .sidebar-box { margin-top: 0; }
  .sidebar-box ul { columns: 3; }
  .sidebar-cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .footer-cols { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .header-inner { flex-wrap: wrap; }
  .nav { display: none; flex-basis: 100%; }
  .nav.open { display: block; }
  .nav > ul { flex-direction: column; background: #251414; }
  .nav .has-menu > ul { display: block; position: static; box-shadow: none; border: 0; background: #381e1e; }
  .nav .has-menu > ul { columns: 2; }
  .box { padding: 20px; }
  .cards-small { grid-template-columns: repeat(2, 1fr); gap: 15px; }
}

@media (max-width: 540px) {
  .logo { font-size: 2rem; }
  .description { font-size: 0.95rem; }
  .section-title, .page-title { font-size: 1.5rem; }
  .box { padding: 12px; }
  .sidebar-box ul { columns: 2; }
  .alignleft, .alignright { float: none; margin: 0 0 10px; }
}
