/* ==========================================================================
   Bida.im — main stylesheet
   Vanilla CSS: design tokens, base, layout, components. No framework.
   ========================================================================== */

/* ---------- Fonts (self-hosted) ---------- */

@font-face {
  font-family: "Inconsolata";
  font-weight: 400;
  font-style: normal;
  src: url("../fonts/Inconsolata-400.ttf") format("truetype");
}
@font-face {
  font-family: "Inconsolata";
  font-weight: 700;
  font-style: normal;
  src: url("../fonts/Inconsolata-700.ttf") format("truetype");
}
@font-face { /* ribbon only */
  font-family: "Poppins";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("fonts/poppins-700.woff2") format("woff2");
}
@font-face { /* homepage service icons */
  font-family: "icomoon";
  font-weight: 400;
  font-style: normal;
  font-display: block;
  src: url("fonts/icomoon.ttf") format("truetype");
}

/* ---------- Design tokens ---------- */

:root {
  --font: "Inconsolata", Arial, sans-serif;
  --font-ribbon: "Poppins", Arial, sans-serif;

  --bg: #fff;
  --bg-alt: #e8e6e9;
  --text: #333;
  --heading: #000;
  --muted: #828282;
  --accent: #623d4f;
  --border: rgba(98, 61, 79, 0.1);
  --card-border: #eee;
  --ribbon-accent: rgb(237, 28, 36);

  --btn-demo: #623d4f;
  --btn-learn: #e8e6e9;
  --btn-warning: #f0ad4e;
  --btn-danger: #d9534f;
  --btn-success: #5cb85c;

  --radius: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lift: 0 12px 24px rgba(0, 0, 0, 0.12);
  --page-width: 62.5rem;
  --prose-width: 46rem;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 1.25rem;
}

p {
  margin: 0 0 1.5rem;
}

a {
  color: var(--heading);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: red;
}
a:hover,
a:focus {
  color: var(--accent);
}

::selection {
  color: #fff;
  background: var(--accent);
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1000;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 0.5rem 1rem;
}
.skip-link:focus {
  top: 1rem;
}

/* ---------- "Keep the Internet free" ribbon ---------- */

.bida-ribbon {
  --ribbon-width: 300px;
  --ribbon-right: -59px;
  --ribbon-top: 70px;

  position: fixed;
  top: var(--ribbon-top);
  right: var(--ribbon-right);
  z-index: 500;
  display: block;
  width: var(--ribbon-width);
  padding: 5px;
  font-family: var(--font-ribbon);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: #1e1935;
  text-align: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.8);
  border-top: 5px solid var(--ribbon-accent);
  border-bottom: 5px solid var(--ribbon-accent);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transform: rotate(45deg);
}
.bida-ribbon:hover,
.bida-ribbon:focus {
  color: #1e1935;
  background: #fff;
}

/* On phones the rotated corner overlaps the header: full-width strip
   instead, page pushed down by exactly its height. */
@media (max-width: 768px) {
  .bida-ribbon {
    inset: 0 0 auto auto;
    width: auto;
    height: 26px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 26px;
    border-top: 0;
    border-bottom: 2px solid var(--ribbon-accent);
    box-shadow: none;
    transform: none;
  }
  body {
    padding-top: 26px;
  }
}

/* ---------- Header / nav (inner pages) ---------- */

.site-header {
  background: var(--bg);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  max-width: 1170px;
  margin-inline: auto;
  padding: 1.75rem 1.5rem;
}

.site-logo {
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--heading);
  text-decoration: none;
}
.site-logo span {
  color: var(--accent);
}

.site-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-menu a {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: rgba(0, 0, 0, 0.7);
  font-weight: 400;
  text-decoration: none;
}
.site-menu a:hover,
.site-menu a:focus,
.site-menu a[aria-current="page"] {
  color: var(--heading);
}

/* On desktop the ribbon is a rotated corner fixed to the top-right and it
   would cover the right-aligned menu links: center the menu instead. */
@media (min-width: 769px) {
  .site-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
  .site-logo {
    grid-column: 1;
    justify-self: start;
  }
  .site-menu {
    grid-column: 2;
  }
}

/* ---------- Home hero ---------- */

.hero {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
}

.hero-logo {
  width: 55%;
  max-width: 320px;
}

.hero h1 {
  font-size: 3.375rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.hero-tagline {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.hero-actions {
  margin: 0;
}

@media (max-width: 768px) {
  .hero {
    padding: 2.5rem 1.25rem 2rem;
  }
  .hero h1 {
    font-size: 1.9rem;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  margin: 0 0.25rem 0.5rem;
  padding: 15px 30px;
  border-radius: 30px;
  background: var(--btn-demo);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 400;
  text-decoration: none;
}
.btn:hover,
.btn:focus {
  color: #fff;
  text-decoration: none;
  filter: brightness(0.93);
}
.btn-learn {
  background: var(--btn-learn);
  color: var(--heading);
}
.btn-learn:hover,
.btn-learn:focus {
  color: var(--heading);
}
.btn-warning {
  background: var(--btn-warning);
}
.btn-danger {
  background: var(--btn-danger);
}
.btn-success {
  background: var(--btn-success);
}

@media (max-width: 768px) {
  .btn {
    display: block;
    width: min(80%, 320px);
    margin-inline: auto;
  }
}

/* ---------- Home: services cards ---------- */

.features {
  background: var(--bg-alt);
  padding: 5rem 1.5rem;
}

.features > h2 {
  text-align: center;
  font-size: 2.125rem;
  margin-bottom: 2.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1170px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.feature-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-align: left;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.feature-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--bg-alt);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.875rem;
}

.feature-copy {
  min-width: 0;
}
.feature-copy h3 {
  font-size: 1.375rem;
  margin-bottom: 0.5rem;
}
.feature-copy p {
  font-size: 0.9375rem;
  margin-bottom: 0.625rem;
}
.feature-copy p:last-child {
  margin-bottom: 0;
}
.feature-copy a {
  color: var(--heading);
}
.feature-copy a:hover {
  color: var(--accent);
}

/* the whole card is the tap target: the single card link is stretched */
.feature-card a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.feature-card:focus-within {
  outline: 3px solid var(--ribbon-accent);
  outline-offset: 2px;
}

@media (hover: hover) {
  .feature-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
  }
}

/* ---------- Pages (shared) ---------- */

.page {
  max-width: var(--page-width);
  margin-inline: auto;
  padding: 3rem 1.5rem 4rem;
}

.prose {
  max-width: var(--prose-width);
  margin-inline: auto;
}

/* ---------- Services gallery ---------- */

.services-header {
  text-align: center;
}

.list-title {
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.gallery-item {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.gallery-item a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  font-weight: 400;
  text-decoration: none;
}

.gallery-item img {
  width: 100%;
  height: 88px;
  object-fit: contain;
}

.gallery-item p {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  .gallery-item {
    padding: 1.5rem;
  }
  .gallery-item img {
    height: 112px;
  }
  .gallery-item p {
    font-size: 1.0625rem;
  }
}

@media (hover: hover) {
  .gallery-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
  }
}

/* ---------- News list ---------- */

.news-item {
  border: 1px solid var(--card-border);
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
}

.news-item .description {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.news-item h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}
.news-item h2 a {
  text-decoration: underline;
}

.news-more {
  text-align: right;
  margin-bottom: 0;
}
.news-more a {
  padding-right: 10px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

/* ---------- Article (news single) ---------- */

.article {
  max-width: var(--prose-width);
  margin-inline: auto;
}

.article h1 {
  font-size: 2rem;
}

.article-date {
  color: var(--muted);
}

.article .prose {
  max-width: none;
  text-align: justify;
}

/* ---------- About ---------- */

.about {
  text-align: center;
}

.about h1 {
  font-size: 2.5rem;
}

.about .prose {
  max-width: 40rem;
}

.about-image {
  margin-bottom: 0;
}
.about-image img {
  border-radius: var(--radius);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer p {
  margin: 0;
}
.site-footer a {
  color: var(--muted);
  font-weight: 400;
}
.site-footer a:hover {
  color: var(--accent);
}

/* ---------- Icons (icomoon, glyphs used on this site only) ---------- */

[class*=" icon-"],
[class^="icon-"] {
  font-family: "icomoon" !important;
  font-style: normal;
  font-weight: 400;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.icon-search::before { content: "\e007"; }
.icon-megaphone::before { content: "\e021"; }
.icon-clock::before { content: "\e055"; }
.icon-book-open::before { content: "\e00b"; }
.icon-upload::before { content: "\e04c"; }
.icon-video::before { content: "\e011"; }
.icon-play::before { content: "\eab8"; }
.icon-users::before { content: "\ea38"; }
.icon-arrow-right22::before { content: "\ebfa"; }

/* ---------- Responsive & motion ---------- */

@media (max-width: 991px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .features {
    padding: 3rem 1.25rem;
  }
  .features > h2 {
    font-size: 1.625rem;
    margin-bottom: 1.75rem;
  }
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  .feature-card {
    padding: 1.125rem;
  }
  .feature-icon {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
  }
  .feature-copy h3 {
    font-size: 1.1875rem;
  }
  .feature-copy p {
    font-size: 0.875rem;
  }
  .page {
    padding: 2rem 1.25rem 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feature-card,
  .gallery-item {
    transition: none;
  }
  .feature-card:hover,
  .gallery-item:hover {
    transform: none;
  }
}
