/**
 * Production theme overrides.
 *
 * Loaded after the base Cassiopeia template CSS (see joomla.asset.json,
 * asset "template.production.theme"). Re-skins the header/nav/footer chrome
 * to visually resemble the live kouinta-production.gr site (which actually
 * runs on a different template framework, Helix Ultimate - see project notes).
 * Plain CSS, no build step required.
 */

:root {
  --production-black: #161616;
  --production-red: #b3131c;
  --production-red-hover: #8f0f16;
}

/* ---- Header shell: kill the default blue gradient, let each row set its own bg ---- */
.container-header {
  background-image: none;
  background-color: transparent;
  box-shadow: none;
}

/* ---- Top bar: social icons (left) + language switcher (right) ---- */
.container-header .container-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background-color: var(--production-black);
  color: #fff;
  font-size: .8125rem;
  padding: .5rem .5rem;
}

.container-header .container-topbar > * {
  margin: 0;
}

.container-header .container-topbar .social-icons {
  order: 1;
}

.container-header .container-topbar .mod-languages {
  order: 2;
}

.container-header .container-topbar a {
  color: #fff;
}

.container-header .container-topbar a:hover,
.container-header .container-topbar a:focus {
  color: var(--production-red);
}

.container-header .container-topbar ul {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---- Brand row (logo) ---- */
.container-header .navbar-brand {
  color: #212529;
}

.container-header .navbar-brand a {
  color: #212529;
}

.container-header .grid-child:has(.navbar-brand) {
  background-color: #fff;
  transition: padding .25s ease;
}

.container-header .navbar-brand img {
  transition: height .25s ease, max-height .25s ease;
}

.container-header.header-scrolled .grid-child:has(.navbar-brand) {
  padding-top: .25rem;
  padding-bottom: .25rem;
}

.container-header.header-scrolled .navbar-brand img {
  height: 32px;
  max-height: 32px;
  width: auto;
}

/* ---- Main nav ---- */
.container-header .container-nav {
  background-color: #fff;
  border-bottom: 3px solid var(--production-red);
  padding-bottom: 0;
  margin-bottom: 0;
}

.container-header .container-nav nav,
.container-header .mod-menu {
  color: var(--production-red);
}

/* Single-row nav is a desktop-only concern; below lg Cassiopeia's own
   collapse/hamburger behaviour (navbar-toggler) takes over. */
@media (min-width: 992px) {
  .container-header .container-nav {
    flex-wrap: nowrap;
  }

  .container-header .mod-menu {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .container-header .mod-menu > li {
    flex-shrink: 0;
  }

  .container-header .mod-menu > li + li {
    margin-left: .9em;
  }

  .container-header .mod-menu > li > a,
  .container-header .mod-menu > li > span {
    font-size: .9rem;
  }
}

.container-header .mod-menu > li > a,
.container-header .mod-menu > li > span {
  color: var(--production-red);
  font-weight: 600;
}

.container-header .mod-menu > li.active > a,
.container-header .mod-menu > li > a:hover {
  color: var(--production-red-hover);
}

.container-header .mod-menu > li.active::after,
.container-header .mod-menu > li:hover::after {
  background: var(--production-red);
}

.container-header .mod-menu .mod-menu__sub {
  background-color: #fff;
  border-top: 3px solid var(--production-red);
}

.container-header .mod-menu .mod-menu__sub a {
  color: var(--production-red);
}

.container-header .navbar-toggler {
  color: var(--production-red);
  border-color: var(--production-red);
}

/* Open dropdown submenus on hover as well as click (desktop only). */
@media (min-width: 992px) {
  .container-header .mod-menu .parent:hover > .mod-menu__sub {
    display: block !important;
  }
}

/* ---- Featured article ribbon (template overrides: html/com_content/{category,featured}/*item.php) ---- */
.item-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

@media (min-width: 992px) {
  .image-left .blog-item .item-image-wrap,
  .image-right .blog-item .item-image-wrap {
    flex: 1 0 40%;
  }
}

.image-right .blog-item .item-image-wrap,
.image-bottom .blog-item .item-image-wrap {
  order: 1;
}

/* No actual intro image (e.g. the picture lives inline in the article body
   instead of the "Intro Image" field) - collapse the empty column instead
   of leaving a blank gap. */
.item-image-wrap:not(:has(.item-image)) {
  display: none;
}

.featured-ribbon {
  position: absolute;
  top: .625rem;
  left: 0;
  background-color: var(--production-red);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
  padding: .375rem .75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
  z-index: 2;
}

/* ---- Footer ---- */
.container-footer.footer {
  background-image: none;
  background-color: var(--production-black);
  color: #fff;
  margin-top: 0;
}

.container-footer.footer .grid-child {
  justify-content: center;
  padding: 1rem .5rem;
  font-size: .8125rem;
  text-align: center;
}

.container-footer.footer a {
  color: #fff;
}

.container-footer.footer a:hover {
  color: var(--production-red);
}

/* ---- Phoca Gallery: turn the fixed-width flex cards into a responsive
   card grid consistent with the rest of the site ---- */
#phocagallery {
  position: relative;
}

#phocagallery > .page-header {
  margin-bottom: .5rem;
  padding-right: 3rem;
}

#phocagallery > .pg-top-icons {
  position: absolute;
  top: 0;
  right: 0;
  float: none;
}

.pg-categories-items-box,
.pg-category-items-box,
.pg-item-items-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.pg-item-box,
.pg-category-box {
  width: auto;
  margin: 0;
  padding: 0;
  align-items: stretch;
  background-color: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 2px hsla(216, 13%, 23%, .1), 0 2px 5px hsla(216, 13%, 23%, .08), 0 5px 15px hsla(216, 13%, 23%, .08);
}

.pg-item-box-image,
.pg-category-box-image {
  width: 100%;
  line-height: 0;
}

.pg-category-box-image img,
.pg-item-box-image img {
  width: 100%;
  height: 11rem;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  display: block;
}

.pg-item-box-info,
.pg-category-box-info {
  padding: .75rem 1rem 1rem;
}

.pg-item-box-title,
.pg-category-box-title {
  margin-top: 0;
}

.pg-item-box-title a,
.pg-category-box-title a {
  color: var(--production-red);
}

/* ---- Homepage hero slider (template override: html/com_content/featured/default.php) ---- */
.cf-hero-slider {
  margin-bottom: 1.75rem;
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--production-black);
}

.cf-hero-slider .carousel-item {
  height: 30rem;
  position: relative;
}

.cf-hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(.6);
}

/* Curated images/hero/ slides (high-res banner photos) - fill the whole
   slider, undimmed, instead of the darkened article-photo treatment. Each
   slide gets its own aspect-ratio inline (computed server-side from the
   actual image file), so "contain" shows the whole image with no crop and
   ~no letterboxing regardless of that image's own proportions. This
   fallback ratio only applies if that inline style is ever missing. */
.cf-hero-slider .carousel-item.cf-hero-slide--plain {
  height: auto;
  aspect-ratio: 16 / 9;
  background-color: var(--production-black);
}

.cf-hero-slide--plain .cf-hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
}

.cf-hero-slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 46rem;
  padding: 3rem 2rem 1.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, .9), rgba(0, 0, 0, 0));
}

.cf-hero-slide-caption h2 {
  margin: 0 0 .5rem;
}

.cf-hero-slide-caption h2 a {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.cf-hero-slide-caption h2 a:hover {
  color: var(--production-red);
}

.cf-hero-slide-excerpt {
  color: #ddd;
  font-size: .9rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.cf-hero-slide-btn {
  display: inline-block;
  background-color: var(--production-red);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-decoration: none;
  padding: .6rem 1.4rem;
  border-radius: 2px;
  transition: background-color .15s;
}

.cf-hero-slide-btn:hover {
  background-color: var(--production-red-hover);
  color: #fff;
}

.cf-hero-slider .carousel-indicators [data-bs-target] {
  background-color: var(--production-red);
}

@media (max-width: 767.98px) {
  .cf-hero-slider .carousel-item {
    height: 18rem;
  }

  .cf-hero-slide-caption {
    padding: 1.5rem 1rem 1rem;
  }

  .cf-hero-slide-caption h2 a {
    font-size: 1.05rem;
  }

  .cf-hero-slide-excerpt {
    display: none;
  }
}
